#include "StdAfx.h"
#include "MentorPartCaeDecal.h"


MentorPartCaeDecal::MentorPartCaeDecal(void)
{
	m_labelNums = 0;
	m_pieces = 0;
	m_terminals = 0;
}


MentorPartCaeDecal::~MentorPartCaeDecal(void)
{
	std::vector<CCircuitUnit*>::iterator SonIt = m_sonUnit.begin();
	while( SonIt!=m_sonUnit.end() )
	{
		delete *SonIt;
		SonIt++;
	}

	m_sonUnit.clear();

	std::vector<Terminal*>::iterator TermIt = m_termsList.begin();
	while( TermIt!=m_termsList.end() )
	{
		delete *TermIt;
		TermIt++;
	}

	m_termsList.clear();

}

void MentorPartCaeDecal::SetDecalName( string &name )
{
	m_decalName = name;
}

void MentorPartCaeDecal::SetLabelNumber( int num )
{
	m_labelNums = num;
}

void MentorPartCaeDecal::SetPieceNumber(int num)
{
	m_pieces = num;
}

void MentorPartCaeDecal::SetTerminalNumber(int num)
{
	m_terminals = num;
}

void MentorPartCaeDecal::AddCircuitUnit( CCircuitUnit *pUnit )
{
	if( pUnit )
		m_sonUnit.push_back(pUnit);
}

void MentorPartCaeDecal::AddTerminal(Terminal* pTerm)
{
	if(pTerm)
		m_termsList.push_back(pTerm);
}

vector<CCircuitUnit*> MentorPartCaeDecal::GetCircuitUnit( )
{
	return m_sonUnit;
}


vector<Terminal*> MentorPartCaeDecal::GetTerminal()
{
	return m_termsList;
}

